﻿using RiderShop.Mobile.Common.Component;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;

namespace RiderShop.Mobile.Controllers
{
    public partial class CustomerController : ThemeController
    {
        /// <summary>
        /// 意见和反馈
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public ActionResult FeedbackSubmit()
        {
            //不继承母版页
            return View("~/Views/Customer/FeedbackSubmit.cshtml");
        }

        /// <summary>
        /// 提交意见和反馈
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public ActionResult FeedbackSubmit(string email, string feedback)
        {
            if (string.IsNullOrEmpty(email))
            {
                return Json(new { Status = false, ErrorMessage = "noHasEmail" }, JsonRequestBehavior.AllowGet);
            }

            if (string.IsNullOrEmpty(feedback))
            {
                return Json(new { Status = false, ErrorMessage = "noHasFeedback" }, JsonRequestBehavior.AllowGet);
            }

            Kevin.Comm.Logger.Tracer.TraceLog("邮箱：" + email + " 意见和建议：" + feedback, "Feedback Submit", "FeedbackSubmit", true);
         
            return Json(new { Status = true, ErrorMessage = "submitSuccessfully" }, JsonRequestBehavior.AllowGet);
        }
    }
}
